<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>快帮行易搜-你就知道</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css"  media="all">
    <link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" media="all" />
    <link rel="stylesheet" href="__CSS__/admin.css"  media="all">
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
    <style type="text/css">
        /* tooltip */
        #tooltip{
            position:absolute;
            border:1px solid #ccc;
            background:#333;
            padding:2px;
            display:none;
            color:#fff;
        }

        .layui-card-header{
            font-size: 18px;
            font-weight:bold;
        }
        .body-box{
            height:250px;
            margin-top:5px;
            overflow-y:overlay;
        }
        .toRes{
            color:blue;
            text-decoration:underline;
        }
        .toRes img{
            display: none;!important;
        }
        .hightlight{
            color:red;
            font-style: italic;
        }
        td {
            height:60px;
        }
    </style>
</head>
<body style="margin: 0 20px">
<fieldset class="layui-elem-field site-demo-button" style="margin-top: 30px;border:0">
    <form class="layui-form" action="{:url('admin/main/index')}" method="post">
        <div class="layui-form-item" style="width:100%;float: left;">
            <div class="layui-input-inline" style="width:60%;margin-bottom:5px;margin-left:16%;text-align: center;color:red;">
                请输入想要查询的资料关键词~
            </div>
            <div class="layui-input-inline" style="width:60%;margin-left:16%;">
                <input autocomplete="off" style="width:100%;height:40px;border: 1px solid #d4d4d4" type="text" name="keywords" value="{if isset($wherelist['keywords'])}{$wherelist['keywords']}{/if}" class="layui-input">
            </div>
            <button style="margin-top:23px;background-color:#38f;" class="layui-btn layui-btn-danger" lay-filter="serch">查询</button>
        </div>
    </form>
</fieldset>

{if !empty($wherelist)}
<fieldset class="layui-elem-field layui-field-title">
    <legend>查询结果</legend>
</fieldset>
{if empty($goodsData) && empty($productData) && empty($poiData) && empty($faqData) && empty($tripData) }
<div class="layui-card">
    <div class="layui-card-body">
        <span style="font-size: 24px;color:black;">未搜到查询的资料，换个关键字再来？</span>
    </div>
</div>
{else}
<div style="width:90%;padding: 20px; background-color: #F2F2F2;margin-bottom:150px;">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            {if !empty($goodsData)}
            <div class="layui-card">
                <div class="layui-card-header" style="height:90px;">
                    商品
                    <table class="layui-table" lay-even="" lay-skin="row">
                        <colgroup>
                            <col width="5%">
                            <col width="10%">
                            <col width="28%">
                            <col width="8%">
                            <col width="10%">
                            <col width="8%">
                            <col width="8%">
                            <col width="5%">
                            <col width="5%">
                            <col width="7%">
                        </colgroup>
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>缩略图</th>
                            <th>商品名称</th>
                            <th>自营/Viator</th>
                            <th>编码/code</th>
                            <th>订单类型</th>
                            <th>售卖状态</th>
                            <th>FAQ</th>
                            <th>附件</th>
                            <th>查询价格</th>
                        </tr>
                        </thead>
                    </table>
                </div>
                <div class="layui-card-body body-box">
                    <table class="layui-table" lay-even="" lay-skin="row">
                        <colgroup>
                            <col width="5%">
                            <col width="10%">
                            <col width="30%">
                            <col width="8%">
                            <col width="10%">
                            <col width="8%">
                            <col width="8%">
                            <col width="5%">
                            <col width="5%">
                            <col width="7%">
                        </colgroup>
                        <tbody>
                        {volist name="goodsData" id="vo"}
                        <tr>
                            <td>{$vo.id}</td>
                            <td style="text-align: center;">
                                <?php
                    if(!empty($vo['goods_image'])){
                    $img=explode(',',$vo['goods_image'] );
                    if(empty($img[1])){
                 ?>
                                <img src="{$vo['goods_image']}" width="64px">
                                <?php  }
                    else{
                ?>
                                <img src="{$img[1]}" width="64px">
                                <?php  }
                    }else{
                }?>
                            </td>
                            <td>
                                <a class="toRes" href="{:url('goods/addgoods',['id'=>$vo.id])}" target="_blank">
                                    {$vo.name}
                                </a>
                            </td>
                            <td>
                                {if $vo.show==1}
                                自营
                                {else}
                                Viator
                                {/if}
                            </td>
                            <td>
                                {if $vo.show==1}
                                {$vo.goods_tcode}
                                {else}
                                {$vo.code}
                                {/if}
                            </td>
                            <td>{$vo.orderType}</td>
                            <td>
                                {if $vo.goods_status==1}
                                <span style="color:green;">售卖中</span>
                                {else}
                                <span style="color:red;">未上架</span>
                                {/if}
                            </td>
                            {if $vo.show==1}
                            <td>-</td>
                            <td>-</td>
                            <td>-</td>
                            {else}
                            <td>
                                {if $vo.faq_flag>0}
                                &nbsp;<a href="{:url('admin/faq/showFaq',['groupid'=>$vo.id,'typeid'=>3])}" class="layui-btn layui-btn-xs layui-btn-warm" target="_blank"  style="margin-right: 0;font-size:12px;">FAQ</a>
                                {else}
                                &nbsp;<a href="{:url('admin/faq/showFaq',['groupid'=>$vo.id,'typeid'=>3])}" class="layui-btn layui-btn-xs layui-btn-primary" target="_blank"  style="margin-right: 0;font-size:12px;">暂无</a>
                                {/if}
                            </td>
                            <td>
                                {if !empty($vo.up_url)}
                                &nbsp;<a href="{:url('admin/goods/savefile',['id'=>$vo.id,'typeid'=>1])}" class="layui-btn layui-btn-xs layui-btn-warm a_menu" target="_blank"  style="margin-right: 0;font-size:12px;">附件</a>
                                {else}
                                &nbsp;<a href="{:url('admin/goods/savefile',['id'=>$vo.id,'typeid'=>1])}" class="layui-btn layui-btn-xs layui-btn-primary a_menu" target="_blank"  style="margin-right: 0;font-size:12px;">暂无</a>
                                {/if}
                            </td>
                            <td>
                                <a href="{:url('admin/goods/showprice')}?id={$vo.id}" data="{$vo.name}" class="layui-btn layui-btn-xs layui-btn-warm showprice"  style="margin-right: 0;font-size:12px;background: darkslategrey">查看</a>
                            </td>
                            {/if}
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                </div>
            </div>
            {/if}
            {if !empty($productData)}
            <div class="layui-card">
                <div class="layui-card-header" style="height:90px;">
                    产品
                    <table class="layui-table" lay-even="" lay-skin="row">
                        <colgroup>
                            <col width="43%">
                            <col width="10%">
                            <col width="5%">
                            <col width="10%">
                            <col width="10%">
                            <col width="7%">
                            <col width="7%">
                            <col width="7%">
                        </colgroup>
                        <thead>
                        <tr>
                            <th>定制名称</th>
                            <th>产品code</th>
                            <th>天数</th>
                            <th>供应商</th>
                            <th>供应商产品号</th>
                            <th>FAQ</th>
                            <th>附件</th>
                            <th>创建人</th>
                        </tr>
                        </thead>
                    </table>
                </div>
                <div class="layui-card-body body-box">
                    <table class="layui-table" lay-even="" lay-skin="row">
                        <colgroup>
                            <col width="44%">
                            <col width="10%">
                            <col width="5%">
                            <col width="10%">
                            <col width="10%">
                            <col width="7%">
                            <col width="7%">
                            <col width="7%">
                        </colgroup>
                        <tbody>
                        {volist name="productData" id="vo"}
                        <tr>
                            <td>
                                <a class="toRes" href="{:url('product/productmake',['id'=>$vo.id])}" target="_blank">
                                    {$vo.name}
                                </a>
                            </td>
                            <td>{$vo.code}</td>
                            <td>{$vo.days}</td>
                            <td>{$vo.supplier_name}</td>
                            <td>{$vo.supplier_item_code}</td>
                            <td>
                                {if $vo.faq_flag>0}
                                &nbsp;<a href="{:url('admin/faq/showFaq',['groupid'=>$vo.id,'typeid'=>1])}" class="layui-btn layui-btn-xs layui-btn-warm" target="_blank"  style="margin-right: 0;font-size:12px;">FAQ</a>
                                {else}
                                &nbsp;<a href="{:url('admin/faq/showFaq',['groupid'=>$vo.id,'typeid'=>1])}" class="layui-btn layui-btn-xs layui-btn-primary" target="_blank"  style="margin-right: 0;font-size:12px;">暂无</a>
                                {/if}
                            </td>
                            <td>
                                {if !empty($vo.up_url)}
                                &nbsp;<a href="{:url('admin/product/savefile',['id'=>$vo.id,'typeid'=>2])}" class="layui-btn layui-btn-xs layui-btn-warm a_menu" target="_blank"  style="margin-right: 0;font-size:12px;">附件</a>
                                {else}
                                &nbsp;<a href="{:url('admin/product/savefile',['id'=>$vo.id,'typeid'=>2])}" class="layui-btn layui-btn-xs layui-btn-primary a_menu" target="_blank"  style="margin-right: 0;font-size:12px;">暂无</a>
                                {/if}
                            </td>
                            <td>{$vo.admin}</td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                </div>
            </div>
            {/if}


            {if !empty($poiData)}
            <div class="layui-card">
                <div class="layui-card-header">POI</div>
                <div class="layui-card-body body-box" style="margin-top:-5px;">
                    <table class="layui-table" lay-even="" lay-skin="row">
                        <tbody>
                        {volist name="poiData" id="vo"}
                        <tr>
                            <td>
                                <a class="toRes" href="{:url('poi/addpoi',['id'=>$vo.id])}" target="_blank">
                                    {$vo.name}
                                </a>
                            </td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                </div>
            </div>
            {/if}

            {if !empty($tripData)}
            <div class="layui-card">
                <div class="layui-card-header" style="height:90px;">
                    定制方案
                    <table class="layui-table" lay-even="" lay-skin="row">
                        <colgroup>
                            <col width="10%">
                            <col width="5%">
                            <col width="85%">
                        </colgroup>
                        <thead>
                        <tr>
                            <th>定制师</th>
                            <th>天数</th>
                            <th>定制名称</th>
                        </tr>
                        </thead>
                    </table>
                </div>
                <div class="layui-card-body body-box">
                    <table class="layui-table" lay-even="" lay-skin="row">
                        <colgroup>
                            <col width="10%">
                            <col width="5%">
                            <col width="85%">
                        </colgroup>
                        <tbody>
                        {volist name="tripData" id="vo"}
                        <tr>
                            <td>{$vo.admin}</td>
                            <td>{$vo.days}</td>
                            <td>
                                <a class="toRes" href="{:url('quicktrip/tripmake',['id'=>$vo.id])}" target="_blank">
                                    {$vo.name}
                                </a>
                            </td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                </div>
            </div>
            {/if}

            {if !empty($faqData)}
            <div class="layui-card">
                <div class="layui-card-header" style="height:90px;">
                    FAQ
                    <table class="layui-table" lay-even="" lay-skin="row">
                        <colgroup>
                            <col width="10%">
                            <col width="45%">
                            <col width="45%">
                        </colgroup>
                        <thead>
                        <tr>
                            <th>FAQ类型</th>
                            <th>标题</th>
                            <th>内容</th>
                        </tr>
                        </thead>
                    </table>
                </div>
                <div class="layui-card-body body-box">
                    <table class="layui-table" lay-even="" lay-skin="row">
                        <colgroup>
                            <col width="10%">
                            <col width="45%">
                            <col width="45%">
                        </colgroup>
                        <tbody>
                        {volist name="faqData" id="vo"}
                            <tr>
                                <td>{$vo.typename}</td>
                                <td>
                                    <a class="toRes" href="{:url('faq/showfaq',['groupid'=>$vo.groupid,'typeid'=>$vo.typeid])}" target="_blank">
                                        {$vo.name}
                                    </a>
                                </td>
                                <td>
                                    <div style="width:100%;">
                                        {$vo.content}
                                    </div>
                                </td>
                            </tr>
                        {/volist}
                        </tbody>
                    </table>
                </div>
            </div>
            {/if}
        </div>
    </div>
</div>
{/if}
{/if}

<script src="__PUBLIC__/layui/layui.js"></script>
<script src="__PUBLIC__/jquery/jquery.min.js"></script>
<script type="text/javascript">
    layui.use('layer', function(){
        var layer = layui.layer;
        $('.a_menu').click(function(){
            var url = $(this).attr('href');
            var a = 0;
            $.ajax({
                url:url
                ,async:false
                ,success:function(res){
                    if(res.code == 0) {
                        layer.msg(res.msg);
                        a = 1;
                    }
                }
            });
            if(a === 0) {
                layer.open({
                    type:2,
                    content:[url, 'no'],
                    area: ['700px', '500px'],
                    end:function(){
                        location.reload();
                    }
                });
            }
            return false;
        });
        $('.showprice').click(function(){
            var url = $(this).attr('href');
            var name = $(this).attr('data');
            layer.open({
                title:name,
                type:2,
                content:url,
                area: ['65%', '95%']
            });
            return false;
        });

        $('.showprice').click(function(){
            var load_index1 = layer.load(2);
        });

        var load_index = layer.load(2);
        $(function(){
            layer.close(load_index);
        });
    });
</script>
</body>
</html>
